<?php
	$url = "http://localhost:8080/moms-diary/services/registration";
/*
	$context = stream_context_create(array(
	    'http' => array(
		'method' => "POST",
		'header' => array(
				"Authorization: Basic " . base64_encode("brainmaster716@gmail.com:122"),
				"Content-Type: application/x-www-form-urlencoded"),
		'content' => http_build_query(
				array(
					"email" => "",
					"firstName" => "yudhi", 
					"lastName" => "Karunia Surtan", 
					"invitationId" => "")
				)
	    )
	));
*/
	$ch = curl_init($url);
	$query = http_build_query(
				array(
					"mail" => "ferdhi.adrian@babytivities.com",
					"firstName" => "ferdhi", 
					"lastName" => "adrian", 
					"invitationId" => "")
				);
	curl_setopt($ch, CURLOPT_HEADER, true);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
//	curl_setopt($ch, CURLOPT_USERPWD, 'brainmaster716@gmail.com:123');
//	curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

	curl_exec($ch);
	$return =  curl_getinfo($ch);
	print_r($return);
	echo $returnp["content_type"]["http_code"];
	curl_close($ch);

	//fclose($fp);	
?>
